package com.example.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class InternalPage extends AnyPage {

	@FindBy (css = "a[href= \"http://localhost:3000/php4dvd/\"]")
	protected WebElement homeLink;
	
	@FindBy (css = "a[href$= \"logout\"]")
	protected WebElement menuLogOutLink;
	
	@FindBy (css = "a[href$= \"profile\"]")
	protected WebElement menuMyProfileLink;
	
	@FindBy (css = "a[href$= \"users\"]")
	protected WebElement userManagementLink;
	
	public void logOut() {
		
		menuLogOutLink.click();
		driver.switchTo().alert().accept();
	}
	public UserPage goToUserManagementPage() {
		userManagementLink.click();
		return MyPageFactory.getPage(driver, UserPage.class);
	}

}
